package com.icoopoo.common.base.icoopoo.util;

import java.util.Collection;
import java.util.Map;

/**
 * @Auther: icoopoo@163.com
 * @Date: 2018/4/25 0025
 * @Description: 字符串通用类
 */
public final class StringUtil {

    public static final boolean isEmpty(Object pObj) {
        if(pObj != null && !"".equals(pObj)) {
            if(pObj instanceof String) {
                if(((String)pObj).trim().length() == 0) {
                    return true;
                }
            } else if(pObj instanceof Collection) {
                if(((Collection)pObj).size() == 0) {
                    return true;
                }
            } else if(pObj instanceof Map && ((Map)pObj).size() == 0) {
                return true;
            }

            return false;
        } else {
            return true;
        }
    }
}
